/*

*/

//thanks garthor
proc
	get_radio_selection(var/client, var/window, var/groupname)
		var/namepos = length(window) + 1
		var/list/L = params2list(winget(client,"[window].*","group;is-checked"))
		// step through the list 2 at a time, so we're only checking the groups
		for(var/v = 1 to L.len step 2)
			var/parampos = findtext(L[v], ".", namepos+1)
			var/param = copytext(L[v], parampos+1)
			// if the button is in the right group
			if(param == "group")
				if(L[L[v]] == groupname)
					// check the value at the next entry (which will be is-checked)
					if(L[L[v+1]] == "true")
						// return the name of the button
						return copytext(L[v], namepos+1, parampos)